import QtQuick 1.1
import com.nokia.symbian 1.1

Page {
    id: mainPage


    Rectangle {
        id: rectCards
        height: 100
        anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
    }

    Component.onCompleted: {
        var cardComp = Qt.createComponent("Carta.qml");
        var cardObj = cardComp.createObject(rectCards);
        cardObj.carregarCarta("A", "paus");
        cardObj = cardComp.createObject(rectCards)
        cardObj.carregarCarta("8", "ouros");
        cardObj = cardComp.createObject(rectCards);
        cardObj.carregarCarta("10", "espadas");
    }


    /*Flickable {
        anchors.fill: parent
        contentWidth: gridCarts.width; contentHeight: gridCarts.height

        Grid {
            id: gridCarts
            columns: 4
        }
    }

    /*Component {
        id: comp
        Image {

        }
    }

    Component.onCompleted: {
        var card = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"];
        var naipes = ["paus", "copas", "espadas", "ouros"];

        for (var i = 0; i < card.length; i++) {
            for (var j = 0; j < naipes.length; j++) {
                var x = comp.createObject(gridCarts);
                x.scale = 0.5;
                console.log(x.width + "x" + x.height);
                x.source = "image://baralho/"  + card[i] + "/" + naipes[j];
            }
        }
    }*/
}
